package com.cy.pj.common.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class JsonResult implements Serializable {
    private static final long serialVersionUID = -8061710668552325428L;
    //消息状态码
    private int state=1;//1表示正确数据,0表示异常数据
    //状态码对应的具体信息
    private  String message="OK";
    //正确数据
    private Object data;

    public JsonResult() {

    }

    public JsonResult(String message) {
        this.message = message;
    }
    //一般查询时调用,封装查询结果
    public JsonResult(Object data) {
        this.data = data;
    }
    //出现异常时调用
   public JsonResult(Throwable t){
        this.state=0;
        this.message=t.getMessage();
   }

}
